<template>
    <div>
      <div>
        <header>
          <el-row type="flex" class="row-bg" justify="space-between">
            <router-link to="">
              <el-col :span="6">
                <div class="grid-content bg-purple">
                  <span class="iconfont" @click="goback">&#xe609;</span>
                </div>
              </el-col>
            </router-link>
          </el-row>
        </header>
        <div style="height: 40.8px"></div>
      </div>
      <div class="toappraise">
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="85px" class="demo-ruleForm" size="medium">
          <el-form-item label="您的感受:" prop="userAppraise">
            <el-input type="textarea" v-model="ruleForm.userAppraise" class="input-box" placeholder="请输入内容"></el-input>
          </el-form-item>
          <el-form-item label="评价等级:" prop="appraiseLevel" style="display: flex; align-items: center;">
            <el-rate v-model="ruleForm.appraiseLevel" show-text></el-rate>
          </el-form-item>
        </el-form>
        <div style="text-align: center;">
          <el-button type="primary" @click="submitForm('ruleForm')" class="but1">提交</el-button>
        </div>
      </div>
    </div>
</template>

<script>
export default {
    name: 'ToAppraise',
    data() {
      return {
        value: null,
        ruleForm: {
          userAppraise: '',
          appraiseLevel: null
        },
        rules: {
          userAppraise: [
            { required: true, message: '请填写感受', trigger: 'blur' }
          ],
          appraiseLevel: [
            { required: true, message: '请打分', trigger: 'blur' }
          ]
        },
      }
    },
    methods: {
      goback() {
        this.$router.back(-1);
      }
    }
}
</script>

<style scoped>
  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    line-height: 2.5rem;
    background: #67C23A;
    text-align: center;
  }
  .iconfont {
    font-size: 1.6rem;
    color: #fff;
    margin-left: .4rem;
  }
  .toappraise {
    margin: 15px 10px 0 10px;
    text-align: center;
  }
  .but1 {
    margin-top: 10px;
  }
</style>